<!DOCTYPE html>
<html lang="en">

<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <meta http-equiv="X-UA-Compatible" content="ie=edge">
  <title>ScreenTest</title>
  <style>
    #info {
      font-size: 16px;
      font-family: monospace;
    }
  </style>
  <script src="./vue.min.js"></script>
  <script src="./vconsole.min.js"></script>
  <script>new VConsole()</script>
</head>

<body>
<div id="info">
  <p>outerWidth：{{outerWidth}} px</p>
  <p>outerHeight：{{outerHeight}} px</p>
  <hr>
  <p>innerWidth：{{innerWidth}} px</p>
  <p>innerHeight：{{innerHeight}} px</p>
  <hr>
  <p>{{navigator.userAgent}}</p>
  <p>devicePixelRatio: {{window.devicePixelRatio}}</p>
</div>

<script>
  var vm = new Vue({
    el: '#info',
    data: {
      outerWidth: null,
      outerHeight: null,
      innerWidth: null,
      innerHeight: null
    },
    mounted: function() {
      var self = this;
      this.getHW();
      window.addEventListener('resize', function() {
        self.getHW();
      })
    },
    methods: {
      getHW: function() {
        this.outerWidth = window.outerWidth;
        this.innerWidth = window.innerWidth;
        this.outerHeight = window.outerHeight;
        this.innerHeight = window.innerHeight;
      }
    }
  })
</script>
</body>

</html>
